$monospace-font: Menlo, Monaco, Consolas, 'Courier New', monospace;
$line-space: 22px;

// DEVUI蓝
$devui-primary: #5e7ce0;
$devui-primary-hover: #7693f5;
$devui-primary-disabled: #beccfa;
$devui-primary-2: #e9edfa;
$devui-primary-1: #f2f5fc;

// 珊瑚红
$devui-danger: #c73636;
$devui-danger-1: #ffeeed;

$devui-text: #252b3a;
$devui-text-weak: #575d6c;
$devui-line: #adb0b8;
$devui-dividing-line: #dfe1e6;
$devui-area: #f8f8f8;
$devui-list-item-strip-bg: #f2f5fc;
$devui-base-bg: #fff;

$devui-border-radius: 2px;

.markdown-body-devui-blue {
  word-break: break-word;
  line-height: 1.75;
  font-weight: 400;
  font-size: 16px;
  overflow-x: hidden;
  color: $devui-text;

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    line-height: 1.5;
    margin-top: 35px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    color: $devui-primary;
  }

  h1 {
    font-size: 24px;
    margin-bottom: 5px;
    margin-top: 80px;
    position: relative;
    text-align: center;
  }
  h2 {
    font-size: 20px;
  }
  h2 {
    padding-bottom: 12px;
    border-bottom: 1px solid $devui-dividing-line;
  }
  h3 {
    font-size: 18px;
    padding-bottom: 0;
  }
  h4 {
    font-size: 16px;
    margin-top: 30px;
  }
  h5 {
    font-size: 14px;
    margin-top: 20px;
  }
  h6 {
    font-size: 14px;
    margin-top: 5px;
  }

  p {
    line-height: inherit;
    margin-top: $line-space;
    margin-bottom: $line-space;
  }

  img {
    max-width: 100%;
  }

  hr {
    border-top: 1px solid $devui-dividing-line;
    border-bottom: none;
    border-left: none;
    border-right: none;
    margin-top: 32px;
    margin-bottom: 32px;
  }

  code {
    font-family: $monospace-font;
    word-break: break-word;
    border-radius: $devui-border-radius;
    overflow-x: auto;
    background-color: $devui-danger-1;
    color: $devui-danger;
    font-size: 0.87em;
    padding: 0.065em 0.4em;
  }

  pre {
    font-family: $monospace-font;
    overflow: auto;
    position: relative;
    line-height: 1.75;
    > code {
      font-size: 12px;
      padding: 15px 12px;
      margin: 0;
      word-break: normal;
      display: block;
      overflow-x: auto;
      color: $devui-text;
      background: $devui-area;
    }
  }

  a {
    position: relative;
    text-decoration: none;
    color: $devui-primary;
    padding-right: 18px;
    padding-bottom: 4px;

    &[href^='http']:after {
      position: absolute;
      display: inline-block;
      width: 16px;
      height: 16px;
      margin-left: 2px;
      margin-top: 6px;
      content: '';
      background: url('');
      background-size: 100%;
    }

    &:hover,
    &:active {
      border-bottom: 2px solid $devui-primary;
    }
  }

  table {
    display: inline-block !important;
    font-size: 12px;
    width: auto;
    max-width: 100%;
    overflow: auto;
    border: solid 1px $devui-primary;
    border-spacing: 0;
  }
  thead {
    color: $devui-base-bg;
    text-align: left;

    tr {
      background: $devui-primary;
    }

    th {
      border-bottom: solid 1px $devui-dividing-line;
    }
  }
  tr {
    background-color: $devui-base-bg;
  }
  tr:nth-child(2n) {
    background-color: $devui-primary-1;
  }
  th,
  td {
    padding: 12px 7px;
    line-height: 24px;
  }
  td {
    min-width: 120px;
  }

  blockquote {
    color: $devui-text;
    padding: 1px 23px;
    margin: 22px 0;
    border-left: 4px solid $devui-primary;
    background-color: $devui-primary-1;
    &::after {
      display: block;
      content: '';
    }
    & > p {
      margin: 10px 0;
    }
  }

  ol,
  ul {
    padding-left: 28px;
    li {
      padding-left: 10px;
      margin-bottom: 0;
      list-style: inherit;
      & .task-list-item {
        list-style: none;
        ul,
        ol {
          margin-top: 0;
        }
      }

      &::marker {
        color: $devui-primary;
      }
    }

    ul,
    ol {
      margin-top: 3px;
    }
  }
  ol li {
    padding-left: 6px;
  }

  ul li {
    &::marker {
      content: '•';
      color: $devui-primary;
    }
  }

  .contains-task-list {
    padding-left: 0;
  }

  .task-list-item {
    list-style: none;
  }

  input[type='checkbox']:before {
    display: inline-block;
    width: 16px;
    height: 16px;
    content: '';
    background: url('');
    background-size: 100%;
    position: relative;
    right: 2px;
    top: -5px;
  }

  input[type='checkbox']:checked:before {
    background: url('');
    background-size: 100%;
  }

  @media (max-width: 720px) {
    h1 {
      font-size: 24px;
    }
    h2 {
      font-size: 20px;
    }
    h3 {
      font-size: 18px;
    }
  }
}
